package controllers

import "encoding/json"

type Result struct {
	Code    int    `json:"code"`
	Message string `json:"msg"`
}

var SUCCESS = Result{200, "success"}
var ERROR_PARAM_INVALID = Result{100000, "param is invalid"}
var ERROR_PARAM_NOT_JSON = Result{100001, "param need json string"}
var ERROR_RECORD_EXIST = Result{100002, "record existed!"}
var ERROR_SYS_WRONG = Result{200001, "system error,please retry again"}
var ERROR_EMAIL_EXIST = Result{200002, "email have binded"}
var ERROR_UPLOAD_FILE = Result{200003, "upload file to tencent cloud error!"}
var ERROR_INVALID_ADDRESS = Result{200004, "invalid wallet address"}
var ERROR_NORMAL = Result{200005, "failed"}

func (r Result) String() string {

	rs, _ := json.Marshal(r)
	return string(rs)
}
